import { CircleNode, CircleNodeModel } from "@logicflow/core";
import {shapeBorderColor} from "../../config";
import {NodeClassType} from "../../util/types";

class LStart extends CircleNode {}

class KStartModel extends CircleNodeModel {
    initNodeData(data: any) {
        super.initNodeData(data);
        // this.r = 30;
    }

    getNodeStyle() {
        const style = super.getNodeStyle();
        style.stroke = shapeBorderColor;
        return style;
    }
    getConnectedTargetRules() {
        const rules = super.getConnectedTargetRules();
        const notAsTarget = {
            message: '起始节点不能作为边的终点',
            validate: () => false,
        };
        rules.push(notAsTarget);
        return rules;
    }
}

export default<NodeClassType> {
    type: "LStart",
    view: LStart,
    model: KStartModel,
    text: '开始',
    icon: 'start',
    order: 0,
    properties: {}
}
